\doxysection{controller\+\_\+functions.\+h}
\hypertarget{controller__functions_8h_source}{}\label{controller__functions_8h_source}\index{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/Middlewares/ST/ARM/DSP/Include/dsp/controller\_functions.h@{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/Middlewares/ST/ARM/DSP/Include/dsp/controller\_functions.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/******************************************************************************}}
\DoxyCodeLine{00002\ \textcolor{comment}{\ *\ @file\ \ \ \ \ controller\_functions.h}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *\ @brief\ \ \ \ Public\ header\ file\ for\ CMSIS\ DSP\ Library}}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *\ @version\ \ V1.10.0}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *\ @date\ \ \ \ \ 08\ July\ 2021}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ *\ Target\ Processor:\ Cortex-\/M\ and\ Cortex-\/A\ cores}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ ******************************************************************************/}}
\DoxyCodeLine{00008\ \textcolor{comment}{/*}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ *\ Copyright\ (c)\ 2010-\/2020\ Arm\ Limited\ or\ its\ affiliates.\ All\ rights\ reserved.}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ *\ SPDX-\/License-\/Identifier:\ Apache-\/2.0}}
\DoxyCodeLine{00012\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ *\ Licensed\ under\ the\ Apache\ License,\ Version\ 2.0\ (the\ License);\ you\ may}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ *\ not\ use\ this\ file\ except\ in\ compliance\ with\ the\ License.}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ *\ You\ may\ obtain\ a\ copy\ of\ the\ License\ at}}
\DoxyCodeLine{00016\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00017\ \textcolor{comment}{\ *\ www.apache.org/licenses/LICENSE-\/2.0}}
\DoxyCodeLine{00018\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00019\ \textcolor{comment}{\ *\ Unless\ required\ by\ applicable\ law\ or\ agreed\ to\ in\ writing,\ software}}
\DoxyCodeLine{00020\ \textcolor{comment}{\ *\ distributed\ under\ the\ License\ is\ distributed\ on\ an\ AS\ IS\ BASIS,\ WITHOUT}}
\DoxyCodeLine{00021\ \textcolor{comment}{\ *\ WARRANTIES\ OR\ CONDITIONS\ OF\ ANY\ KIND,\ either\ express\ or\ implied.}}
\DoxyCodeLine{00022\ \textcolor{comment}{\ *\ See\ the\ License\ for\ the\ specific\ language\ governing\ permissions\ and}}
\DoxyCodeLine{00023\ \textcolor{comment}{\ *\ limitations\ under\ the\ License.}}
\DoxyCodeLine{00024\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00025\ }
\DoxyCodeLine{00026\ \ }
\DoxyCodeLine{00027\ \textcolor{preprocessor}{\#ifndef\ \_CONTROLLER\_FUNCTIONS\_H\_}}
\DoxyCodeLine{00028\ \textcolor{preprocessor}{\#define\ \_CONTROLLER\_FUNCTIONS\_H\_}}
\DoxyCodeLine{00029\ }
\DoxyCodeLine{00030\ \textcolor{preprocessor}{\#include\ "{}arm\_math\_types.h"{}}}
\DoxyCodeLine{00031\ \textcolor{preprocessor}{\#include\ "{}arm\_math\_memory.h"{}}}
\DoxyCodeLine{00032\ }
\DoxyCodeLine{00033\ \textcolor{preprocessor}{\#include\ "{}dsp/none.h"{}}}
\DoxyCodeLine{00034\ \textcolor{preprocessor}{\#include\ "{}dsp/utils.h"{}}}
\DoxyCodeLine{00035\ }
\DoxyCodeLine{00036\ \textcolor{preprocessor}{\#ifdef\ \ \ \_\_cplusplus}}
\DoxyCodeLine{00037\ \textcolor{keyword}{extern}\ \textcolor{stringliteral}{"{}C"{}}}
\DoxyCodeLine{00038\ \{}
\DoxyCodeLine{00039\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00040\ }
\DoxyCodeLine{00044\ }
\DoxyCodeLine{00045\ \textcolor{preprocessor}{\#define\ CONTROLLER\_Q31\_SHIFT\ \ (32\ -\/\ 9)}}
\DoxyCodeLine{00046\ \ \ \textcolor{comment}{/*\ 1.31(q31)\ Fixed\ value\ of\ 2/360\ */}}
\DoxyCodeLine{00047\ \ \ \textcolor{comment}{/*\ -\/1\ to\ +1\ is\ divided\ into\ 360\ values\ so\ total\ spacing\ is\ (2/360)\ */}}
\DoxyCodeLine{00048\ \textcolor{preprocessor}{\#define\ INPUT\_SPACING\ \ \ \ \ \ \ \ \ 0xB60B61}}
\DoxyCodeLine{00049\ \ \ }
\DoxyCodeLine{00053\ }
\DoxyCodeLine{00054\ }
\DoxyCodeLine{00058\ }
\DoxyCodeLine{00083\ \ }
\DoxyCodeLine{00090\ \ \ \textcolor{keywordtype}{void}\ arm\_sin\_cos\_f32(}
\DoxyCodeLine{00091\ \ \ \ \ \ \ \ \ float32\_t\ theta,}
\DoxyCodeLine{00092\ \ \ \ \ \ \ \ \ float32\_t\ *\ pSinVal,}
\DoxyCodeLine{00093\ \ \ \ \ \ \ \ \ float32\_t\ *\ pCosVal);}
\DoxyCodeLine{00094\ }
\DoxyCodeLine{00095\ }
\DoxyCodeLine{00102\ \ \ \textcolor{keywordtype}{void}\ arm\_sin\_cos\_q31(}
\DoxyCodeLine{00103\ \ \ \ \ \ \ \ \ q31\_t\ theta,}
\DoxyCodeLine{00104\ \ \ \ \ \ \ \ \ q31\_t\ *\ pSinVal,}
\DoxyCodeLine{00105\ \ \ \ \ \ \ \ \ q31\_t\ *\ pCosVal);}
\DoxyCodeLine{00106\ }
\DoxyCodeLine{00107\ }
\DoxyCodeLine{00111\ \ \ }
\DoxyCodeLine{00169\ }
\DoxyCodeLine{00170\ }
\DoxyCodeLine{00175\ \ \ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct}}
\DoxyCodeLine{00176\ \ \ \{}
\DoxyCodeLine{00177\ \ \ \ \ \ \ \ \ \ \ q15\_t\ A0;\ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00178\ \textcolor{preprocessor}{\#if\ !defined\ (ARM\_MATH\_DSP)}}
\DoxyCodeLine{00179\ \ \ \ \ \ \ \ \ \ \ q15\_t\ A1;\ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00180\ \ \ \ \ \ \ \ \ \ \ q15\_t\ A2;\ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00181\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00182\ \ \ \ \ \ \ \ \ \ \ q31\_t\ A1;\ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00183\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00184\ \ \ \ \ \ \ \ \ \ \ q15\_t\ state[3];\ \ \ \ \ }
\DoxyCodeLine{00185\ \ \ \ \ \ \ \ \ \ \ q15\_t\ Kp;\ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00186\ \ \ \ \ \ \ \ \ \ \ q15\_t\ Ki;\ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00187\ \ \ \ \ \ \ \ \ \ \ q15\_t\ Kd;\ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00188\ \ \ \}\ \mbox{\hyperlink{structarm__pid__instance__q15}{arm\_pid\_instance\_q15}};}
\DoxyCodeLine{00189\ }
\DoxyCodeLine{00194\ \ \ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct}}
\DoxyCodeLine{00195\ \ \ \{}
\DoxyCodeLine{00196\ \ \ \ \ \ \ \ \ \ \ q31\_t\ A0;\ \ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00197\ \ \ \ \ \ \ \ \ \ \ q31\_t\ A1;\ \ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00198\ \ \ \ \ \ \ \ \ \ \ q31\_t\ A2;\ \ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00199\ \ \ \ \ \ \ \ \ \ \ q31\_t\ state[3];\ \ \ \ \ \ }
\DoxyCodeLine{00200\ \ \ \ \ \ \ \ \ \ \ q31\_t\ Kp;\ \ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00201\ \ \ \ \ \ \ \ \ \ \ q31\_t\ Ki;\ \ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00202\ \ \ \ \ \ \ \ \ \ \ q31\_t\ Kd;\ \ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00203\ \ \ \}\ \mbox{\hyperlink{structarm__pid__instance__q31}{arm\_pid\_instance\_q31}};}
\DoxyCodeLine{00204\ }
\DoxyCodeLine{00209\ \ \ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct}}
\DoxyCodeLine{00210\ \ \ \{}
\DoxyCodeLine{00211\ \ \ \ \ \ \ \ \ \ \ float32\_t\ A0;\ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00212\ \ \ \ \ \ \ \ \ \ \ float32\_t\ A1;\ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00213\ \ \ \ \ \ \ \ \ \ \ float32\_t\ A2;\ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00214\ \ \ \ \ \ \ \ \ \ \ float32\_t\ state[3];\ \ \ \ }
\DoxyCodeLine{00215\ \ \ \ \ \ \ \ \ \ \ float32\_t\ Kp;\ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00216\ \ \ \ \ \ \ \ \ \ \ float32\_t\ Ki;\ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00217\ \ \ \ \ \ \ \ \ \ \ float32\_t\ Kd;\ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00218\ \ \ \}\ \mbox{\hyperlink{structarm__pid__instance__f32}{arm\_pid\_instance\_f32}};}
\DoxyCodeLine{00219\ }
\DoxyCodeLine{00220\ }
\DoxyCodeLine{00221\ }
\DoxyCodeLine{00227\ \ \ \textcolor{keywordtype}{void}\ arm\_pid\_init\_f32(}
\DoxyCodeLine{00228\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structarm__pid__instance__f32}{arm\_pid\_instance\_f32}}\ *\ S,}
\DoxyCodeLine{00229\ \ \ \ \ \ \ \ \ int32\_t\ resetStateFlag);}
\DoxyCodeLine{00230\ }
\DoxyCodeLine{00231\ }
\DoxyCodeLine{00236\ \ \ \textcolor{keywordtype}{void}\ arm\_pid\_reset\_f32(}
\DoxyCodeLine{00237\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structarm__pid__instance__f32}{arm\_pid\_instance\_f32}}\ *\ S);}
\DoxyCodeLine{00238\ }
\DoxyCodeLine{00239\ }
\DoxyCodeLine{00245\ \ \ \textcolor{keywordtype}{void}\ arm\_pid\_init\_q31(}
\DoxyCodeLine{00246\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structarm__pid__instance__q31}{arm\_pid\_instance\_q31}}\ *\ S,}
\DoxyCodeLine{00247\ \ \ \ \ \ \ \ \ int32\_t\ resetStateFlag);}
\DoxyCodeLine{00248\ }
\DoxyCodeLine{00249\ }
\DoxyCodeLine{00254\ }
\DoxyCodeLine{00255\ \ \ \textcolor{keywordtype}{void}\ arm\_pid\_reset\_q31(}
\DoxyCodeLine{00256\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structarm__pid__instance__q31}{arm\_pid\_instance\_q31}}\ *\ S);}
\DoxyCodeLine{00257\ }
\DoxyCodeLine{00258\ }
\DoxyCodeLine{00264\ \ \ \textcolor{keywordtype}{void}\ arm\_pid\_init\_q15(}
\DoxyCodeLine{00265\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structarm__pid__instance__q15}{arm\_pid\_instance\_q15}}\ *\ S,}
\DoxyCodeLine{00266\ \ \ \ \ \ \ \ \ int32\_t\ resetStateFlag);}
\DoxyCodeLine{00267\ }
\DoxyCodeLine{00268\ }
\DoxyCodeLine{00273\ \ \ \textcolor{keywordtype}{void}\ arm\_pid\_reset\_q15(}
\DoxyCodeLine{00274\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structarm__pid__instance__q15}{arm\_pid\_instance\_q15}}\ *\ S);}
\DoxyCodeLine{00275\ }
\DoxyCodeLine{00276\ }
\DoxyCodeLine{00277\ }
\DoxyCodeLine{00278\ }
\DoxyCodeLine{00279\ }
\DoxyCodeLine{00287\ \ \ \_\_STATIC\_FORCEINLINE\ float32\_t\ \mbox{\hyperlink{group___p_i_d_ga5a6865ed706b7dd969ef0bd58a61f306}{arm\_pid\_f32}}(}
\DoxyCodeLine{00288\ \ \ \mbox{\hyperlink{structarm__pid__instance__f32}{arm\_pid\_instance\_f32}}\ *\ S,}
\DoxyCodeLine{00289\ \ \ float32\_t\ in)}
\DoxyCodeLine{00290\ \ \ \{}
\DoxyCodeLine{00291\ \ \ \ \ float32\_t\ out;}
\DoxyCodeLine{00292\ }
\DoxyCodeLine{00293\ \ \ \ \ \textcolor{comment}{/*\ y[n]\ =\ y[n-\/1]\ +\ A0\ *\ x[n]\ +\ A1\ *\ x[n-\/1]\ +\ A2\ *\ x[n-\/2]\ \ */}}
\DoxyCodeLine{00294\ \ \ \ \ out\ =\ (S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_ad7b0bed64915d0a25a3409fa2dc45556}{A0}}\ *\ in)\ +}
\DoxyCodeLine{00295\ \ \ \ \ \ \ (S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_a7def89571c50f7137a213326a396e560}{A1}}\ *\ S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_ac8ef2ec43648e986c99e1df96c68a36f}{state}}[0])\ +\ (S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_a155acf642ba2f521869f19d694cd7fa0}{A2}}\ *\ S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_ac8ef2ec43648e986c99e1df96c68a36f}{state}}[1])\ +\ (S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_ac8ef2ec43648e986c99e1df96c68a36f}{state}}[2]);}
\DoxyCodeLine{00296\ }
\DoxyCodeLine{00297\ \ \ \ \ \textcolor{comment}{/*\ Update\ state\ */}}
\DoxyCodeLine{00298\ \ \ \ \ S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_ac8ef2ec43648e986c99e1df96c68a36f}{state}}[1]\ =\ S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_ac8ef2ec43648e986c99e1df96c68a36f}{state}}[0];}
\DoxyCodeLine{00299\ \ \ \ \ S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_ac8ef2ec43648e986c99e1df96c68a36f}{state}}[0]\ =\ in;}
\DoxyCodeLine{00300\ \ \ \ \ S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_ac8ef2ec43648e986c99e1df96c68a36f}{state}}[2]\ =\ out;}
\DoxyCodeLine{00301\ }
\DoxyCodeLine{00302\ \ \ \ \ \textcolor{comment}{/*\ return\ to\ application\ */}}
\DoxyCodeLine{00303\ \ \ \ \ \textcolor{keywordflow}{return}\ (out);}
\DoxyCodeLine{00304\ }
\DoxyCodeLine{00305\ \ \ \}}
\DoxyCodeLine{00306\ }
\DoxyCodeLine{00321\ \_\_STATIC\_FORCEINLINE\ q31\_t\ \mbox{\hyperlink{group___p_i_d_ga9ead8b3180125fb42879389477b99dc8}{arm\_pid\_q31}}(}
\DoxyCodeLine{00322\ \ \ \mbox{\hyperlink{structarm__pid__instance__q31}{arm\_pid\_instance\_q31}}\ *\ S,}
\DoxyCodeLine{00323\ \ \ q31\_t\ in)}
\DoxyCodeLine{00324\ \ \ \{}
\DoxyCodeLine{00325\ \ \ \ \ q63\_t\ acc;}
\DoxyCodeLine{00326\ \ \ \ \ q31\_t\ out;}
\DoxyCodeLine{00327\ }
\DoxyCodeLine{00328\ \ \ \ \ \textcolor{comment}{/*\ acc\ =\ A0\ *\ x[n]\ \ */}}
\DoxyCodeLine{00329\ \ \ \ \ acc\ =\ (q63\_t)\ S-\/>\mbox{\hyperlink{structarm__pid__instance__q31_aa5332635ce9c7078cdb4c1ecf442eadd}{A0}}\ *\ in;}
\DoxyCodeLine{00330\ }
\DoxyCodeLine{00331\ \ \ \ \ \textcolor{comment}{/*\ acc\ +=\ A1\ *\ x[n-\/1]\ */}}
\DoxyCodeLine{00332\ \ \ \ \ acc\ +=\ (q63\_t)\ S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_a7def89571c50f7137a213326a396e560}{A1}}\ *\ S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_ac8ef2ec43648e986c99e1df96c68a36f}{state}}[0];}
\DoxyCodeLine{00333\ }
\DoxyCodeLine{00334\ \ \ \ \ \textcolor{comment}{/*\ acc\ +=\ A2\ *\ x[n-\/2]\ \ */}}
\DoxyCodeLine{00335\ \ \ \ \ acc\ +=\ (q63\_t)\ S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_a155acf642ba2f521869f19d694cd7fa0}{A2}}\ *\ S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_ac8ef2ec43648e986c99e1df96c68a36f}{state}}[1];}
\DoxyCodeLine{00336\ }
\DoxyCodeLine{00337\ \ \ \ \ \textcolor{comment}{/*\ convert\ output\ to\ 1.31\ format\ to\ add\ y[n-\/1]\ */}}
\DoxyCodeLine{00338\ \ \ \ \ out\ =\ (q31\_t)\ (acc\ >>\ 31U);}
\DoxyCodeLine{00339\ }
\DoxyCodeLine{00340\ \ \ \ \ \textcolor{comment}{/*\ out\ +=\ y[n-\/1]\ */}}
\DoxyCodeLine{00341\ \ \ \ \ out\ +=\ S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_ac8ef2ec43648e986c99e1df96c68a36f}{state}}[2];}
\DoxyCodeLine{00342\ }
\DoxyCodeLine{00343\ \ \ \ \ \textcolor{comment}{/*\ Update\ state\ */}}
\DoxyCodeLine{00344\ \ \ \ \ S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_ac8ef2ec43648e986c99e1df96c68a36f}{state}}[1]\ =\ S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_ac8ef2ec43648e986c99e1df96c68a36f}{state}}[0];}
\DoxyCodeLine{00345\ \ \ \ \ S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_ac8ef2ec43648e986c99e1df96c68a36f}{state}}[0]\ =\ in;}
\DoxyCodeLine{00346\ \ \ \ \ S-\/>\mbox{\hyperlink{structarm__pid__instance__f32_ac8ef2ec43648e986c99e1df96c68a36f}{state}}[2]\ =\ out;}
\DoxyCodeLine{00347\ }
\DoxyCodeLine{00348\ \ \ \ \ \textcolor{comment}{/*\ return\ to\ application\ */}}
\DoxyCodeLine{00349\ \ \ \ \ \textcolor{keywordflow}{return}\ (out);}
\DoxyCodeLine{00350\ \ \ \}}
\DoxyCodeLine{00351\ }
\DoxyCodeLine{00352\ }
\DoxyCodeLine{00368\ \_\_STATIC\_FORCEINLINE\ q15\_t\ \mbox{\hyperlink{group___p_i_d_ga7ecc87208cb297fb9a31cec4f18bb54e}{arm\_pid\_q15}}(}
\DoxyCodeLine{00369\ \ \ \mbox{\hyperlink{structarm__pid__instance__q15}{arm\_pid\_instance\_q15}}\ *\ S,}
\DoxyCodeLine{00370\ \ \ q15\_t\ in)}
\DoxyCodeLine{00371\ \ \ \{}
\DoxyCodeLine{00372\ \ \ \ \ q63\_t\ acc;}
\DoxyCodeLine{00373\ \ \ \ \ q15\_t\ out;}
\DoxyCodeLine{00374\ }
\DoxyCodeLine{00375\ \textcolor{preprocessor}{\#if\ defined\ (ARM\_MATH\_DSP)}}
\DoxyCodeLine{00376\ \ \ \ \ \textcolor{comment}{/*\ Implementation\ of\ PID\ controller\ */}}
\DoxyCodeLine{00377\ }
\DoxyCodeLine{00378\ \ \ \ \ \textcolor{comment}{/*\ acc\ =\ A0\ *\ x[n]\ \ */}}
\DoxyCodeLine{00379\ \ \ \ \ acc\ =\ (q31\_t)\ \_\_SMUAD((uint32\_t)S-\/>\mbox{\hyperlink{structarm__pid__instance__q15_ad77f3a2823c7f96de42c92a3fbf3246b}{A0}},\ (uint32\_t)in);}
\DoxyCodeLine{00380\ }
\DoxyCodeLine{00381\ \ \ \ \ \textcolor{comment}{/*\ acc\ +=\ A1\ *\ x[n-\/1]\ +\ A2\ *\ x[n-\/2]\ \ */}}
\DoxyCodeLine{00382\ \ \ \ \ acc\ =\ (q63\_t)\_\_SMLALD((uint32\_t)S-\/>\mbox{\hyperlink{structarm__pid__instance__q15_ad8ac5ff736c0e51180398c31f777f18a}{A1}},\ (uint32\_t)read\_q15x2\ (S-\/>\mbox{\hyperlink{structarm__pid__instance__q15_a3c54b074a2a3d1bbc2fe2589fcc25231}{state}}),\ (uint64\_t)acc);}
\DoxyCodeLine{00383\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00384\ \ \ \ \ \textcolor{comment}{/*\ acc\ =\ A0\ *\ x[n]\ \ */}}
\DoxyCodeLine{00385\ \ \ \ \ acc\ =\ ((q31\_t)\ S-\/>\mbox{\hyperlink{structarm__pid__instance__q15_ad77f3a2823c7f96de42c92a3fbf3246b}{A0}})\ *\ in;}
\DoxyCodeLine{00386\ }
\DoxyCodeLine{00387\ \ \ \ \ \textcolor{comment}{/*\ acc\ +=\ A1\ *\ x[n-\/1]\ +\ A2\ *\ x[n-\/2]\ \ */}}
\DoxyCodeLine{00388\ \ \ \ \ acc\ +=\ (q31\_t)\ S-\/>\mbox{\hyperlink{structarm__pid__instance__q15_ad8ac5ff736c0e51180398c31f777f18a}{A1}}\ *\ S-\/>\mbox{\hyperlink{structarm__pid__instance__q15_a3c54b074a2a3d1bbc2fe2589fcc25231}{state}}[0];}
\DoxyCodeLine{00389\ \ \ \ \ acc\ +=\ (q31\_t)\ S-\/>\mbox{\hyperlink{structarm__pid__instance__q15_a33e8b4c2d3e24b8b494f6edca6a89c1b}{A2}}\ *\ S-\/>\mbox{\hyperlink{structarm__pid__instance__q15_a3c54b074a2a3d1bbc2fe2589fcc25231}{state}}[1];}
\DoxyCodeLine{00390\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00391\ }
\DoxyCodeLine{00392\ \ \ \ \ \textcolor{comment}{/*\ acc\ +=\ y[n-\/1]\ */}}
\DoxyCodeLine{00393\ \ \ \ \ acc\ +=\ (q31\_t)\ S-\/>\mbox{\hyperlink{structarm__pid__instance__q15_a3c54b074a2a3d1bbc2fe2589fcc25231}{state}}[2]\ <<\ 15;}
\DoxyCodeLine{00394\ }
\DoxyCodeLine{00395\ \ \ \ \ \textcolor{comment}{/*\ saturate\ the\ output\ */}}
\DoxyCodeLine{00396\ \ \ \ \ out\ =\ (q15\_t)\ (\mbox{\hyperlink{group___c_m_s_i_s___core___instruction_interface_ga372c0535573dde3e37f0f08c774a3487}{\_\_SSAT}}((q31\_t)(acc\ >>\ 15),\ 16));}
\DoxyCodeLine{00397\ }
\DoxyCodeLine{00398\ \ \ \ \ \textcolor{comment}{/*\ Update\ state\ */}}
\DoxyCodeLine{00399\ \ \ \ \ S-\/>\mbox{\hyperlink{structarm__pid__instance__q15_a3c54b074a2a3d1bbc2fe2589fcc25231}{state}}[1]\ =\ S-\/>\mbox{\hyperlink{structarm__pid__instance__q15_a3c54b074a2a3d1bbc2fe2589fcc25231}{state}}[0];}
\DoxyCodeLine{00400\ \ \ \ \ S-\/>\mbox{\hyperlink{structarm__pid__instance__q15_a3c54b074a2a3d1bbc2fe2589fcc25231}{state}}[0]\ =\ in;}
\DoxyCodeLine{00401\ \ \ \ \ S-\/>\mbox{\hyperlink{structarm__pid__instance__q15_a3c54b074a2a3d1bbc2fe2589fcc25231}{state}}[2]\ =\ out;}
\DoxyCodeLine{00402\ }
\DoxyCodeLine{00403\ \ \ \ \ \textcolor{comment}{/*\ return\ to\ application\ */}}
\DoxyCodeLine{00404\ \ \ \ \ \textcolor{keywordflow}{return}\ (out);}
\DoxyCodeLine{00405\ \ \ \}}
\DoxyCodeLine{00406\ }
\DoxyCodeLine{00407\ }
\DoxyCodeLine{00408\ }
\DoxyCodeLine{00412\ }
\DoxyCodeLine{00436\ }
\DoxyCodeLine{00437\ \ }
\DoxyCodeLine{00438\ }
\DoxyCodeLine{00453\ \ \ \_\_STATIC\_FORCEINLINE\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group__park_ga18f92d09e080edc98a00c01886b56b5d}{arm\_park\_f32}}(}
\DoxyCodeLine{00454\ \ \ float32\_t\ Ialpha,}
\DoxyCodeLine{00455\ \ \ float32\_t\ Ibeta,}
\DoxyCodeLine{00456\ \ \ float32\_t\ *\ pId,}
\DoxyCodeLine{00457\ \ \ float32\_t\ *\ pIq,}
\DoxyCodeLine{00458\ \ \ float32\_t\ sinVal,}
\DoxyCodeLine{00459\ \ \ float32\_t\ cosVal)}
\DoxyCodeLine{00460\ \ \ \{}
\DoxyCodeLine{00461\ \ \ \ \ \textcolor{comment}{/*\ Calculate\ pId\ using\ the\ equation,\ pId\ =\ Ialpha\ *\ cosVal\ +\ Ibeta\ *\ sinVal\ */}}
\DoxyCodeLine{00462\ \ \ \ \ *pId\ =\ Ialpha\ *\ cosVal\ +\ Ibeta\ *\ sinVal;}
\DoxyCodeLine{00463\ }
\DoxyCodeLine{00464\ \ \ \ \ \textcolor{comment}{/*\ Calculate\ pIq\ using\ the\ equation,\ pIq\ =\ -\/\ Ialpha\ *\ sinVal\ +\ Ibeta\ *\ cosVal\ */}}
\DoxyCodeLine{00465\ \ \ \ \ *pIq\ =\ -\/Ialpha\ *\ sinVal\ +\ Ibeta\ *\ cosVal;}
\DoxyCodeLine{00466\ \ \ \}}
\DoxyCodeLine{00467\ }
\DoxyCodeLine{00468\ }
\DoxyCodeLine{00485\ \_\_STATIC\_FORCEINLINE\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group__park_ga69be76685149b18f345f705aa8efaad0}{arm\_park\_q31}}(}
\DoxyCodeLine{00486\ \ \ q31\_t\ Ialpha,}
\DoxyCodeLine{00487\ \ \ q31\_t\ Ibeta,}
\DoxyCodeLine{00488\ \ \ q31\_t\ *\ pId,}
\DoxyCodeLine{00489\ \ \ q31\_t\ *\ pIq,}
\DoxyCodeLine{00490\ \ \ q31\_t\ sinVal,}
\DoxyCodeLine{00491\ \ \ q31\_t\ cosVal)}
\DoxyCodeLine{00492\ \ \ \{}
\DoxyCodeLine{00493\ \ \ \ \ q31\_t\ product1,\ product2;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ Temporary\ variables\ used\ to\ store\ intermediate\ results\ */}}
\DoxyCodeLine{00494\ \ \ \ \ q31\_t\ product3,\ product4;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ Temporary\ variables\ used\ to\ store\ intermediate\ results\ */}}
\DoxyCodeLine{00495\ }
\DoxyCodeLine{00496\ \ \ \ \ \textcolor{comment}{/*\ Intermediate\ product\ is\ calculated\ by\ (Ialpha\ *\ cosVal)\ */}}
\DoxyCodeLine{00497\ \ \ \ \ product1\ =\ (q31\_t)\ (((q63\_t)\ (Ialpha)\ *\ (cosVal))\ >>\ 31);}
\DoxyCodeLine{00498\ }
\DoxyCodeLine{00499\ \ \ \ \ \textcolor{comment}{/*\ Intermediate\ product\ is\ calculated\ by\ (Ibeta\ *\ sinVal)\ */}}
\DoxyCodeLine{00500\ \ \ \ \ product2\ =\ (q31\_t)\ (((q63\_t)\ (Ibeta)\ *\ (sinVal))\ >>\ 31);}
\DoxyCodeLine{00501\ }
\DoxyCodeLine{00502\ }
\DoxyCodeLine{00503\ \ \ \ \ \textcolor{comment}{/*\ Intermediate\ product\ is\ calculated\ by\ (Ialpha\ *\ sinVal)\ */}}
\DoxyCodeLine{00504\ \ \ \ \ product3\ =\ (q31\_t)\ (((q63\_t)\ (Ialpha)\ *\ (sinVal))\ >>\ 31);}
\DoxyCodeLine{00505\ }
\DoxyCodeLine{00506\ \ \ \ \ \textcolor{comment}{/*\ Intermediate\ product\ is\ calculated\ by\ (Ibeta\ *\ cosVal)\ */}}
\DoxyCodeLine{00507\ \ \ \ \ product4\ =\ (q31\_t)\ (((q63\_t)\ (Ibeta)\ *\ (cosVal))\ >>\ 31);}
\DoxyCodeLine{00508\ }
\DoxyCodeLine{00509\ \ \ \ \ \textcolor{comment}{/*\ Calculate\ pId\ by\ adding\ the\ two\ intermediate\ products\ 1\ and\ 2\ */}}
\DoxyCodeLine{00510\ \ \ \ \ *pId\ =\ \_\_QADD(product1,\ product2);}
\DoxyCodeLine{00511\ }
\DoxyCodeLine{00512\ \ \ \ \ \textcolor{comment}{/*\ Calculate\ pIq\ by\ subtracting\ the\ two\ intermediate\ products\ 3\ from\ 4\ */}}
\DoxyCodeLine{00513\ \ \ \ \ *pIq\ =\ \_\_QSUB(product4,\ product3);}
\DoxyCodeLine{00514\ \ \ \}}
\DoxyCodeLine{00515\ }
\DoxyCodeLine{00516\ }
\DoxyCodeLine{00517\ }
\DoxyCodeLine{00521\ }
\DoxyCodeLine{00538\ }
\DoxyCodeLine{00539\ \ \ }
\DoxyCodeLine{00540\ }
\DoxyCodeLine{00552\ \ \ \_\_STATIC\_FORCEINLINE\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group__inv__park_ga896b639ecd52c33d427bc7cdc8d303b2}{arm\_inv\_park\_f32}}(}
\DoxyCodeLine{00553\ \ \ float32\_t\ Id,}
\DoxyCodeLine{00554\ \ \ float32\_t\ Iq,}
\DoxyCodeLine{00555\ \ \ float32\_t\ *\ pIalpha,}
\DoxyCodeLine{00556\ \ \ float32\_t\ *\ pIbeta,}
\DoxyCodeLine{00557\ \ \ float32\_t\ sinVal,}
\DoxyCodeLine{00558\ \ \ float32\_t\ cosVal)}
\DoxyCodeLine{00559\ \ \ \{}
\DoxyCodeLine{00560\ \ \ \ \ \textcolor{comment}{/*\ Calculate\ pIalpha\ using\ the\ equation,\ pIalpha\ =\ Id\ *\ cosVal\ -\/\ Iq\ *\ sinVal\ */}}
\DoxyCodeLine{00561\ \ \ \ \ *pIalpha\ =\ Id\ *\ cosVal\ -\/\ Iq\ *\ sinVal;}
\DoxyCodeLine{00562\ }
\DoxyCodeLine{00563\ \ \ \ \ \textcolor{comment}{/*\ Calculate\ pIbeta\ using\ the\ equation,\ pIbeta\ =\ Id\ *\ sinVal\ +\ Iq\ *\ cosVal\ */}}
\DoxyCodeLine{00564\ \ \ \ \ *pIbeta\ =\ Id\ *\ sinVal\ +\ Iq\ *\ cosVal;}
\DoxyCodeLine{00565\ \ \ \}}
\DoxyCodeLine{00566\ }
\DoxyCodeLine{00567\ }
\DoxyCodeLine{00584\ \_\_STATIC\_FORCEINLINE\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group__inv__park_gae7165779ef72e1f797d0c601d6d619b2}{arm\_inv\_park\_q31}}(}
\DoxyCodeLine{00585\ \ \ q31\_t\ Id,}
\DoxyCodeLine{00586\ \ \ q31\_t\ Iq,}
\DoxyCodeLine{00587\ \ \ q31\_t\ *\ pIalpha,}
\DoxyCodeLine{00588\ \ \ q31\_t\ *\ pIbeta,}
\DoxyCodeLine{00589\ \ \ q31\_t\ sinVal,}
\DoxyCodeLine{00590\ \ \ q31\_t\ cosVal)}
\DoxyCodeLine{00591\ \ \ \{}
\DoxyCodeLine{00592\ \ \ \ \ q31\_t\ product1,\ product2;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ Temporary\ variables\ used\ to\ store\ intermediate\ results\ */}}
\DoxyCodeLine{00593\ \ \ \ \ q31\_t\ product3,\ product4;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ Temporary\ variables\ used\ to\ store\ intermediate\ results\ */}}
\DoxyCodeLine{00594\ }
\DoxyCodeLine{00595\ \ \ \ \ \textcolor{comment}{/*\ Intermediate\ product\ is\ calculated\ by\ (Id\ *\ cosVal)\ */}}
\DoxyCodeLine{00596\ \ \ \ \ product1\ =\ (q31\_t)\ (((q63\_t)\ (Id)\ *\ (cosVal))\ >>\ 31);}
\DoxyCodeLine{00597\ }
\DoxyCodeLine{00598\ \ \ \ \ \textcolor{comment}{/*\ Intermediate\ product\ is\ calculated\ by\ (Iq\ *\ sinVal)\ */}}
\DoxyCodeLine{00599\ \ \ \ \ product2\ =\ (q31\_t)\ (((q63\_t)\ (Iq)\ *\ (sinVal))\ >>\ 31);}
\DoxyCodeLine{00600\ }
\DoxyCodeLine{00601\ }
\DoxyCodeLine{00602\ \ \ \ \ \textcolor{comment}{/*\ Intermediate\ product\ is\ calculated\ by\ (Id\ *\ sinVal)\ */}}
\DoxyCodeLine{00603\ \ \ \ \ product3\ =\ (q31\_t)\ (((q63\_t)\ (Id)\ *\ (sinVal))\ >>\ 31);}
\DoxyCodeLine{00604\ }
\DoxyCodeLine{00605\ \ \ \ \ \textcolor{comment}{/*\ Intermediate\ product\ is\ calculated\ by\ (Iq\ *\ cosVal)\ */}}
\DoxyCodeLine{00606\ \ \ \ \ product4\ =\ (q31\_t)\ (((q63\_t)\ (Iq)\ *\ (cosVal))\ >>\ 31);}
\DoxyCodeLine{00607\ }
\DoxyCodeLine{00608\ \ \ \ \ \textcolor{comment}{/*\ Calculate\ pIalpha\ by\ using\ the\ two\ intermediate\ products\ 1\ and\ 2\ */}}
\DoxyCodeLine{00609\ \ \ \ \ *pIalpha\ =\ \_\_QSUB(product1,\ product2);}
\DoxyCodeLine{00610\ }
\DoxyCodeLine{00611\ \ \ \ \ \textcolor{comment}{/*\ Calculate\ pIbeta\ by\ using\ the\ two\ intermediate\ products\ 3\ and\ 4\ */}}
\DoxyCodeLine{00612\ \ \ \ \ *pIbeta\ =\ \_\_QADD(product4,\ product3);}
\DoxyCodeLine{00613\ \ \ \}}
\DoxyCodeLine{00614\ }
\DoxyCodeLine{00615\ }
\DoxyCodeLine{00619\ }
\DoxyCodeLine{00641\ }
\DoxyCodeLine{00642\ }
\DoxyCodeLine{00653\ \ \ \_\_STATIC\_FORCEINLINE\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group__clarke_ga82d40c62bb48ef4d613f1f2f685b4084}{arm\_clarke\_f32}}(}
\DoxyCodeLine{00654\ \ \ float32\_t\ Ia,}
\DoxyCodeLine{00655\ \ \ float32\_t\ Ib,}
\DoxyCodeLine{00656\ \ \ float32\_t\ *\ pIalpha,}
\DoxyCodeLine{00657\ \ \ float32\_t\ *\ pIbeta)}
\DoxyCodeLine{00658\ \ \ \{}
\DoxyCodeLine{00659\ \ \ \ \ \textcolor{comment}{/*\ Calculate\ pIalpha\ using\ the\ equation,\ pIalpha\ =\ Ia\ */}}
\DoxyCodeLine{00660\ \ \ \ \ *pIalpha\ =\ Ia;}
\DoxyCodeLine{00661\ }
\DoxyCodeLine{00662\ \ \ \ \ \textcolor{comment}{/*\ Calculate\ pIbeta\ using\ the\ equation,\ pIbeta\ =\ (1/sqrt(3))\ *\ Ia\ +\ (2/sqrt(3))\ *\ Ib\ */}}
\DoxyCodeLine{00663\ \ \ \ \ *pIbeta\ =\ (0.57735026919f\ *\ Ia\ +\ 1.15470053838f\ *\ Ib);}
\DoxyCodeLine{00664\ \ \ \}}
\DoxyCodeLine{00665\ }
\DoxyCodeLine{00666\ }
\DoxyCodeLine{00681\ \_\_STATIC\_FORCEINLINE\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group__clarke_ga8d68db2a6e26e1caab677f5ab293c068}{arm\_clarke\_q31}}(}
\DoxyCodeLine{00682\ \ \ q31\_t\ Ia,}
\DoxyCodeLine{00683\ \ \ q31\_t\ Ib,}
\DoxyCodeLine{00684\ \ \ q31\_t\ *\ pIalpha,}
\DoxyCodeLine{00685\ \ \ q31\_t\ *\ pIbeta)}
\DoxyCodeLine{00686\ \ \ \{}
\DoxyCodeLine{00687\ \ \ \ \ q31\_t\ product1,\ product2;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ Temporary\ variables\ used\ to\ store\ intermediate\ results\ */}}
\DoxyCodeLine{00688\ }
\DoxyCodeLine{00689\ \ \ \ \ \textcolor{comment}{/*\ Calculating\ pIalpha\ from\ Ia\ by\ equation\ pIalpha\ =\ Ia\ */}}
\DoxyCodeLine{00690\ \ \ \ \ *pIalpha\ =\ Ia;}
\DoxyCodeLine{00691\ }
\DoxyCodeLine{00692\ \ \ \ \ \textcolor{comment}{/*\ Intermediate\ product\ is\ calculated\ by\ (1/(sqrt(3))\ *\ Ia)\ */}}
\DoxyCodeLine{00693\ \ \ \ \ product1\ =\ (q31\_t)\ (((q63\_t)\ Ia\ *\ 0x24F34E8B)\ >>\ 30);}
\DoxyCodeLine{00694\ }
\DoxyCodeLine{00695\ \ \ \ \ \textcolor{comment}{/*\ Intermediate\ product\ is\ calculated\ by\ (2/sqrt(3)\ *\ Ib)\ */}}
\DoxyCodeLine{00696\ \ \ \ \ product2\ =\ (q31\_t)\ (((q63\_t)\ Ib\ *\ 0x49E69D16)\ >>\ 30);}
\DoxyCodeLine{00697\ }
\DoxyCodeLine{00698\ \ \ \ \ \textcolor{comment}{/*\ pIbeta\ is\ calculated\ by\ adding\ the\ intermediate\ products\ */}}
\DoxyCodeLine{00699\ \ \ \ \ *pIbeta\ =\ \_\_QADD(product1,\ product2);}
\DoxyCodeLine{00700\ \ \ \}}
\DoxyCodeLine{00701\ }
\DoxyCodeLine{00702\ }
\DoxyCodeLine{00703\ }
\DoxyCodeLine{00707\ }
\DoxyCodeLine{00723\ }
\DoxyCodeLine{00724\ \ }
\DoxyCodeLine{00725\ }
\DoxyCodeLine{00735\ \ \ \_\_STATIC\_FORCEINLINE\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group__inv__clarke_ga1a73ce96f94b2124d02426690e587197}{arm\_inv\_clarke\_f32}}(}
\DoxyCodeLine{00736\ \ \ float32\_t\ Ialpha,}
\DoxyCodeLine{00737\ \ \ float32\_t\ Ibeta,}
\DoxyCodeLine{00738\ \ \ float32\_t\ *\ pIa,}
\DoxyCodeLine{00739\ \ \ float32\_t\ *\ pIb)}
\DoxyCodeLine{00740\ \ \ \{}
\DoxyCodeLine{00741\ \ \ \ \ \textcolor{comment}{/*\ Calculating\ pIa\ from\ Ialpha\ by\ equation\ pIa\ =\ Ialpha\ */}}
\DoxyCodeLine{00742\ \ \ \ \ *pIa\ =\ Ialpha;}
\DoxyCodeLine{00743\ }
\DoxyCodeLine{00744\ \ \ \ \ \textcolor{comment}{/*\ Calculating\ pIb\ from\ Ialpha\ and\ Ibeta\ by\ equation\ pIb\ =\ -\/(1/2)\ *\ Ialpha\ +\ (sqrt(3)/2)\ *\ Ibeta\ */}}
\DoxyCodeLine{00745\ \ \ \ \ *pIb\ =\ -\/0.5f\ *\ Ialpha\ +\ 0.8660254039f\ *\ Ibeta;}
\DoxyCodeLine{00746\ \ \ \}}
\DoxyCodeLine{00747\ }
\DoxyCodeLine{00748\ }
\DoxyCodeLine{00763\ \_\_STATIC\_FORCEINLINE\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group__inv__clarke_ga3bab178431f22d13332a0dfae4390172}{arm\_inv\_clarke\_q31}}(}
\DoxyCodeLine{00764\ \ \ q31\_t\ Ialpha,}
\DoxyCodeLine{00765\ \ \ q31\_t\ Ibeta,}
\DoxyCodeLine{00766\ \ \ q31\_t\ *\ pIa,}
\DoxyCodeLine{00767\ \ \ q31\_t\ *\ pIb)}
\DoxyCodeLine{00768\ \ \ \{}
\DoxyCodeLine{00769\ \ \ \ \ q31\_t\ product1,\ product2;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ Temporary\ variables\ used\ to\ store\ intermediate\ results\ */}}
\DoxyCodeLine{00770\ }
\DoxyCodeLine{00771\ \ \ \ \ \textcolor{comment}{/*\ Calculating\ pIa\ from\ Ialpha\ by\ equation\ pIa\ =\ Ialpha\ */}}
\DoxyCodeLine{00772\ \ \ \ \ *pIa\ =\ Ialpha;}
\DoxyCodeLine{00773\ }
\DoxyCodeLine{00774\ \ \ \ \ \textcolor{comment}{/*\ Intermediate\ product\ is\ calculated\ by\ (1/(2*sqrt(3))\ *\ Ia)\ */}}
\DoxyCodeLine{00775\ \ \ \ \ product1\ =\ (q31\_t)\ (((q63\_t)\ (Ialpha)\ *\ (0x40000000))\ >>\ 31);}
\DoxyCodeLine{00776\ }
\DoxyCodeLine{00777\ \ \ \ \ \textcolor{comment}{/*\ Intermediate\ product\ is\ calculated\ by\ (1/sqrt(3)\ *\ pIb)\ */}}
\DoxyCodeLine{00778\ \ \ \ \ product2\ =\ (q31\_t)\ (((q63\_t)\ (Ibeta)\ *\ (0x6ED9EBA1))\ >>\ 31);}
\DoxyCodeLine{00779\ }
\DoxyCodeLine{00780\ \ \ \ \ \textcolor{comment}{/*\ pIb\ is\ calculated\ by\ subtracting\ the\ products\ */}}
\DoxyCodeLine{00781\ \ \ \ \ *pIb\ =\ \_\_QSUB(product2,\ product1);}
\DoxyCodeLine{00782\ \ \ \}}
\DoxyCodeLine{00783\ }
\DoxyCodeLine{00784\ }
\DoxyCodeLine{00785\ }
\DoxyCodeLine{00786\ }
\DoxyCodeLine{00787\ }
\DoxyCodeLine{00788\ \ \ }
\DoxyCodeLine{00789\ \textcolor{preprocessor}{\#ifdef\ \ \ \_\_cplusplus}}
\DoxyCodeLine{00790\ \}}
\DoxyCodeLine{00791\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00792\ }
\DoxyCodeLine{00793\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{/*\ ifndef\ \_CONTROLLER\_FUNCTIONS\_H\_\ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
